#if !defined(_CALAYOUT_H_)
#define _CALAYOUT_H_

#include "AObject.h"

class CASpritesPatternChild : public CAObject
{
public:
	CASpritesPatternChild();
	virtual ~CASpritesPatternChild();
	CAString name;
	CAString gname;
	CAString ref;
	//1:x 2:y 3:xy
	int usexy;
	CCPoint pos;
	CAString pose;
};

class CASpritesPattern : public CAObject
{
protected:
	CAString _name;
	CAStringMap<CASpritesPatternChild>* _children;
public:
	CASpritesPattern();
	virtual ~CASpritesPattern(void);

	int initialize(const char* pszRes);

	//vector<CAString> getChildrenKeys() const { return _children->allKeys(); }
	inline CCArray* getChildrenKeys() const { return _children->allKeys(); }
	inline CASpritesPatternChild* getChild(const CAString& name) const { return (CASpritesPatternChild*)_children->objectForKey(name); }
};

#endif //_CALAYOUT_H_